home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / pcl4p51.zip / PCL4P16.PAS < prev    next >
Pascal/Delphi Source File  |  1996-06-05  |  5KB  |  204 lines

  1. unit PCL4P16;
  2.  
  3. interface
  4.  
  5. uses WinApi, use_dpmi;
  6.  
  7. const
  8.    (* COMM Ports *)
  9.    COM1 = 0;
  10.    COM2 = 1;
  11.    COM3 = 2;
  12.    COM4 = 3;
  13.    COM5 = 4;
  14.    COM6 = 5;
  15.    COM7 = 6;
  16.    COM8 = 7;
  17.    COM9 = 8;
  18.    COM10 =  9;
  19.    COM11 = 10;
  20.    COM12 = 11;
  21.    COM13 = 12;
  22.    COM14 = 13;
  23.    COM15 = 14;
  24.    COM16 = 15;
  25.    COM17 = 16;
  26.    COM18 = 17;
  27.    COM19 = 18;
  28.    COM20 = 19;
  29.    (* Baud Rate Codes *)
  30.    NORESET  = -1;
  31.    Baud300  = 0;
  32.    Baud600  = 1;
  33.    Baud1200 = 2;
  34.    Baud2400 = 3;
  35.    Baud4800 = 4;
  36.    Baud9600 = 5;
  37.    Baud19200  = 6;
  38.    Baud38400  = 7;
  39.    Baud57600  = 8;
  40.    Baud115200 = 9;
  41.    (* Parity Codes *)
  42.    NoParity  = 0;
  43.    OddParity = 1;
  44.    EvenParity= 3;
  45.    (* Stop Bit Codes *)
  46.    OneStopBit  = 0;
  47.    TwoStopBits = 1;
  48.    (* Word Length Codes *)
  49.    WordLength5 = 0;
  50.    WordLength6 = 1;
  51.    WordLength7 = 2;
  52.    WordLength8 = 3;
  53.    (* Buffer Size Codes *)
  54.    Size128  = 4;
  55.    Size256  = 5;
  56.    Size512  = 6;
  57.    Size1024 = 7;
  58.    Size2048 = 8;
  59.    Size4096 = 9;
  60.    Size8192 =  10;
  61.    Size16384 = 11;
  62.    Size32768 = 12;
  63.    Size1K = 7;
  64.    Size2K = 8;
  65.    Size4K = 9;
  66.    Size8K = 10;
  67.    Size16K = 11;
  68.    Size32K = 12;
  69.    (* Line Status Masks *)
  70.    TransBufferEmpty = $20;
  71.    BreakDetect  = $10;
  72.    FramingError = $08;
  73.    ParityError  = $04;
  74.    OverrunError = $02;
  75.    DataReady    = $01;
  76.    (* Modem Status Masks *)
  77.    DCD = $80;
  78.    RI  = $40;
  79.    DSR = $20;
  80.    CTS = $10;
  81.    DeltaDCD = $08;
  82.    DeltaRI  = $04;
  83.    DeltaDSR = $02;
  84.    DeltaCTS = $01;
  85.    (* Break Signal Commands *)
  86.    ASSERT = 'A';
  87.    CANCEL = 'C';
  88.    DETECT = 'D';
  89.    (* SioDTR & SioRTS Commands *)
  90.    SetPort = 'S';
  91.    ClrPort = 'C';
  92.    ReadPort = 'R';
  93.    (* FIFO level codes *)
  94.    LEVEL_1 =  0;
  95.    LEVEL_4 =  1;
  96.    LEVEL_8 =  2;
  97.    LEVEL_14 = 3;
  98.    (* IRQ codes *)
  99.    IRQ1  =  1;
  100.    IRQ2  =  2;
  101.    IRQ3  =  3;
  102.    IRQ4  =  4;
  103.    IRQ5  =  5;
  104.    IRQ6  =  6;
  105.    IRQ7  =  7;
  106.    IRQ8  =  8;
  107.    IRQ9  =  9;
  108.    IRQ10 = 10;
  109.    IRQ11 = 11;
  110.    IRQ12 = 12;
  111.    IRQ13 = 13;
  112.    IRQ14 = 14;
  113.    IRQ15 = 15;
  114.    (* SioInfo arguments *)
  115.    VERSION = 'V';
  116.    TRANSMITTER = 'I';
  117.    (* timeing constants *)
  118.    ONE_SECOND = 18;
  119.    SHORT_WAIT = 4;
  120.    LONG_WAIT = 10;
  121.    (* CardType constants *)
  122.    PC_PORTS = 0;
  123.    DIGIBOARD = 1;
  124.    BOCABOARD = 2;
  125.  
  126. function SioBaud(Port, BaudCode : Integer) : Integer;
  127. function SioBrkKey : Boolean;
  128. function SioBrkSig(Port : Integer; Cmd : Char) : Integer;
  129. function SioCTS(Port : Integer) : Integer;
  130. function SioDCD(Port : Integer) : Integer;
  131. procedure SioDelay(Tics : Integer);
  132. function SioDone(Port : Integer) : Integer;
  133. function SioDSR(Port : Integer) : Integer;
  134. function SioDTR(Port : Integer; Cmd : Char) : Integer;
  135. function SioError(Code : Integer) : Integer;
  136. function SioFIFO(Port, Code : Integer) : Integer;
  137. function SioFlow(Port, Tics : Integer) : Integer;
  138. function SioGetc(Port, Tics : Integer) : Integer;
  139. function SioGetDiv(Port : Integer) : Integer;
  140. function SioInfo(Cmd : Char) : Integer;
  141. function SioIRQ(Port, IRQcode : Integer) : Integer;
  142. function SioLine(Port : Integer) : Integer;
  143. function SioLoopBack(Port : Integer) : Integer;
  144. function SioModem(Port, Mask : Integer) : Integer;
  145. function SioParms(Port, ParityCode, StopBitsCode, WordLengthCode : Integer) : Integer;
  146. function SioPorts(NumberPorts, FirstPort, StatusReg, CardType : Integer) : Integer;
  147. function SioPutc(Port : Integer; Ch : Char) : Integer;
  148. function SioRead(Port, Register : Integer) : Integer;
  149. function SioReset(Port, BaudCode : Integer) : Integer;
  150. function SioRI(Port : Integer) : Integer;
  151. function SioRTS(Port : Integer; Cmd : Char ) : Integer;
  152. function SioRxBuf(Port, BufferSeg, SizeCode : Integer) : Integer;
  153. function SioRxClear(Port : Integer) : Integer;
  154. function SioRxQue(Port : Integer) : Integer;
  155. function SioTimer : LongInt;
  156. function SioTxBuf(Port, BufferSeg, SizeCode : Integer) : Integer;
  157. function SioTxClear(Port : Integer) : Integer;
  158. function SioTxFlush(Port : Integer) : Integer;
  159. function SioTxQue(Port : Integer) : Integer;
  160. function SioUART(Port, Address : Integer) : Integer;
  161. function SioUnGetc(Port : Integer; Ch : Byte ) : Integer;
  162.  
  163.  
  164. implementation
  165.  
  166. {$L PCL4P16}
  167.  
  168. function SioBaud ; external;
  169. function SioBrkKey ; external;
  170. function SioBrkSig ; external;
  171. function SioCTS ; external;
  172. function SioDCD ; external;
  173. procedure SioDelay ; external;
  174. function SioDone ; external;
  175. function SioDSR ; external ;
  176. function SioDTR ; external;
  177. function SioError ; external;
  178. function SioFIFO ; external;
  179. function SioFlow ; external;
  180. function SioGetc ; external;
  181. function SioGetDiv ; external;
  182. function SioInfo ; external;
  183. function SioIRQ ; external;
  184. function SioLine ; external;
  185. function SioLoopBack ; external;
  186. function SioModem ; external;
  187. function SioParms ; external;
  188. function SioPorts ; external;
  189. function SioPutc ; external;
  190. function SioRead ; external;
  191. function SioReset ; external;
  192. function SioRI ; external;
  193. function SioRTS ; external;
  194. function SioRxBuf ; external;
  195. function SioRxClear ; external;
  196. function SioRxQue ; external;
  197. function SioTimer ; external;
  198. function SioTxBuf ; external;
  199. function SioTxClear ; external;
  200. function SioTxFlush ; external;
  201. function SioTxQue ; external;
  202. function SioUART ; external;
  203. function SioUnGetc ; external;
  204. end.